﻿#region usings
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Messaging;
using InsuranceAdjuster;
using InsuranceAdjuster.Services;
using InsuranceAdjuster.Web.Models;
using InsuranceAdjuster.Models;
using Papa.Common;
#endregion

namespace InsuranceAdjuster.ViewModels {
    public class VehicleViewModel : ViewModel {

                #region Initializers
        // Services
        protected Services.IPageConductor PageConductor { get; set; }
        protected Services.IInsuranceAdjusterDataService DataService { get; set; }


        public VehicleViewModel(Services.IPageConductor pageConductor,
                Services.IInsuranceAdjusterDataService dataService) {
            this.PageConductor = pageConductor;
            this.Vehicles = new ObservableCollection<Vehicle>();

            LoadVehicles();

        }
        public override void LoadData() {
            LoadVehicles();
        }

        private void LoadVehicles(){
            this.Vehicles.Add(new Car() { Year = 2004, Make = "Acura", Model = "TSX", Color = "Grey", MaxPassengers = 5, VIN = "0B1234567Y03" });
            this.Vehicles.Add(new Car() { Year = 2010, Make = "BMW", Model = "7 Series", Color = "Black", MaxPassengers = 5, VIN = "1C7654321Z32" });
            this.Vehicles.Add(new Truck() { Year = 1994, Make = "Kenworth", Model = "T700", Color = "Blue", GrossWeight = 80000, Height = 96, Length = 54, VIN = "Z3876543232" });
            this.Vehicles.Add(new Motorcycle() { Year = 200, Make = "Ducati", Model = "996", Color = "Yellow", VIN = "UR987678931" });
        }
        #endregion

        private ObservableCollection<Models.Vehicle> _vehicles;
        public ObservableCollection<Models.Vehicle> Vehicles {
            get { return _vehicles; }
            set {
                if (value != _vehicles) {
                    _vehicles = value;
                    RaisePropertyChanged("Vehicles");
                }
            }
        }
        
    }
}
